package im.vinci.server.user.persistence;

import im.vinci.server.user.domain.UserInfo;
import im.vinci.server.user.domain.UserLocation;
import im.vinci.server.user.persistence.handler.UserLocationHandler;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;

/**
 * Created by mingjie on 17/2/14.
 */
@Repository
public interface SystemUserInfoMapper {
    @Select("select * from system_user_info where id=#{id}")
    @Results({
            @Result(column = "location", property = "location", javaType = UserLocation.class, jdbcType = JdbcType.VARCHAR, typeHandler = UserLocationHandler.class)
    })
    UserInfo getSystemUserInfoById(@Param("id") long id);
}
